<?php

declare(strict_types=1);

namespace app\index\logic;

use app\common\model\User as ModelUser;

class User
{
    /**
     * 获取个人中心数据
     */
    public static function getMine(int $uid): array
    {
        $user = ModelUser::field('nickname,headimgurl')->findOrEmpty($uid);
        $user->isEmpty() && fault('用户不存在');
        $user = $user->toArray();
        return $user;
    }
}
